-
Notifications
You must be signed in to change notification settings - Fork 2.3k
feat: Add telemetry tracking for task terminations and user intent classification #8835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Fixes ESLint react-hooks/exhaustive-deps warning - Ensures callback properly updates when termination click count changes
Code Review SummaryI've reviewed the telemetry tracking implementation for task terminations. The changes look solid overall with proper event schemas, telemetry capture methods, and intent classification logic. Issues Found
Review NotesThe implementation successfully:
|
|
|
||
| const trimmedInput = text?.trim() | ||
|
|
||
| if (isStreaming) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding an inline comment to explain that the first cancel click is interpreted as a course correction, while subsequent clicks indicate task abandonment.
| const taskHistory = this.getGlobalState("taskHistory") ?? [] | ||
| const currentTaskItem = taskHistory.find((item: HistoryItem) => item.id === task.taskId) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variables taskHistory and currentTaskItem are declared but never used in the telemetry tracking logic. These can be removed to clean up the code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review complete. Found 1 minor issue to address (unused variables).
This PR addresses Issue #8832 by implementing comprehensive telemetry tracking for task terminations.
Summary
Adds telemetry tracking to understand user behavior patterns when terminating tasks, specifically distinguishing between:
Implementation Details
New Telemetry Events
TASK_TERMINATED: General termination event with contextual dataTASK_CORRECTED: First termination attempt (course correction)TASK_ABANDONED: Multiple termination attempts (abandonment)Changes Made
Added telemetry event types (
packages/types/src/telemetry.ts)Implemented capture methods (
packages/telemetry/src/TelemetryService.ts)captureTaskTerminated(): Records general termination with contextcaptureTaskCorrected(): Tracks single-click course correctionscaptureTaskAbandoned(): Tracks multi-click abandonmentsEnhanced ClineProvider (
src/core/webview/ClineProvider.ts)cancelTask()methodAdded frontend click tracking (
webview-ui/src/components/chat/ChatView.tsx)Updated message interfaces (
src/shared/WebviewMessage.ts,src/core/webview/webviewMessageHandler.ts)clickCountparameter for termination trackingKey Features
Testing
Related Issue
Closes #8832
Feedback and suggestions are welcome!
Important
Add telemetry tracking for task terminations, classifying user intent based on click count and task state, with new events and frontend-backend integration.
TASK_TERMINATED,TASK_CORRECTED,TASK_ABANDONEDevents intelemetry.ts.captureTaskTerminated(),captureTaskCorrected(),captureTaskAbandoned()inTelemetryService.ts.cancelTask()inClineProvider.tsto track termination click count and classify user intent.ChatView.tsx.WebviewMessage.ts.clickCountparameter inWebviewMessage.tsfor termination tracking.This description was created by
for a15d43c. You can customize this summary. It will automatically update as commits are pushed.